The USB is originally developed for personal computers (PCs). The USB also offers many advantages for many embedded applications. However, running the USBD and HCD on the same CPU or microprocessor or microcontroller in an embedded system that runs the application programs often complicates the hardware and software designs, and the operating system if there is one, of an embedded system. The CPU, or microprocessor or microcontroller in an embedded system that runs the application programs will be referred to the Main Processor or Application Processor hereafter. By the Main Processor or Application Processor it is understood that it is composed of the hardware of a CPU or microprocessor or microcontroller, its I/O interfaces, and the associated software or firmware including an operating system when appropriate. Sometimes, there is not enough system resource on the Main Processor to run the USB Driver and Host Controller Driver. This invention solves these problems with a dedicated processor in the host system, implementing the USBD and HCD, thus, simplifying the hardware and software architecture and the operating system of an embedded system.
A USB host is technically complex, requiring long learning curves. An apparatus that can implement the complex functions of a USB host and presents a simple, high level interface to the Application Processor of an embedded system is desired. The USB host system of this invention implements the USBD, HCD and HC inside the said system and presents a simple high level interface with a microprocessor, thus hiding the difficult details of the USB protocols, USB traffic scheduling, bandwidth management, error handling and recovery, and electrical signaling away from an embedded system developer and from the microprocessor and operating system of the embedded system. This will enable an embedded system developer to integrate an USB host into an embedded system without knowing the technical details of USB, and shorten the time-to-market of his products.
In prior art as shown in the two industry-standard USB host specifications, the “Universal Host Controller Interface (UHCI) Design Guide” Revision 1.1 published by the Intel Corporation, and the “OpenHCI: Open Host Controller Interface Specification for USB,” (OHCI) Revision 1.0a, published by Compaq, Microsoft and National Semiconductor, to achieve high transfer rates on USB, the Host Controller requires a bus interface with bus master capability, such as a PCI bus, to interface with the CPU. In many embedded systems, there is no PCI bus. The interface between the USB host system of this invention and a microprocessor or a microcontroller is a non-PCI standard microprocessor bus interface.
The major differences between this invention and prior art USB hosts are given below:
1. In prior art USB host specifications and implementations, the USBD and HCD are run on the CPU of the PC, or the same processor as the application programs. In this invention, the USBD and HCD are run on a separate processor.
2. Prior art USB host specifications and implementations on PCs and platforms with PCI bus use the OHCI or the UHCI. The OHCI and UHCI are too complicated for embedded systems. This invention does not present an OHCI or UHCI to the Main Processor, rather it presents an interface to the application Client Software at the much higher level of USB pipes since this invention implements the complete USB host system including the USBD and HCD.
3. Prior USB host specifications and implementations depend on operating systems calls to access the USB host functions. This invention may provide the user full USB host functions using Application Programming Interfaces (APIs), thus, it can be used to provide USB host functions to an embedded system without an operating system, or with an operating system that does not support USB.
4. In an prior art USB host implementation that contains the USBD and HCD managed by an operating system supporting USB, the host system of this invention can still be used by intercepting the calls to the USBD and pass the calls to the USBD in the host system of this invention to process the calls.
5. Prior art USB host specification and implementations on PCs depend on bus mastering such as the PCI bus to interface the CPU or Application Processor with the USB Host Controller. This invention uses standard microprocessor bus between the USB host system and the Main Processor.
There are USB host related products for embedded systems. ScanLogic, Inc. of Bedford, Mass. makes a USB Host Controller SL11H. The SL11H is only a Host Controller, it only relates to a small part of in this invention. The SL11H does not have a programmable processor. The USBD and HCD still have to be run on the same processor as the application programs. VAutomation, Inc. of Nashua, NH offers a synthesizable HDL core of a USB Host Controller with the Host Controller function implemented using software on a RISC processor. This again only relates to a small part of in this invention. It has a programmable processor which only implements the HC. There are other similar products. None of these products offer a complete USB host system with the unique features of this invention, and none of them offer all types of USB command and pipe mechanisms. These products only implement a USB host controller, and USBD and HCD are to be implemented and run on the same processor as the application programs.
The solution to USB host for embedded systems such as those provided by ScanLogic Inc., Vautomation Inc. and similar products have serious disadvantages: Running the USBD and HCD on the Main Processor will take away significant time and memory resources from the application programs. There will be very frequent interrupts (one interrupt for each USB transaction) from the HC to the Main Processor. Since both the application programs and the USB host software all are implemented on the Main Processor, the software structure and management on the Main Processor becomes very complicated.
It is not obvious to use a processor separate from the Main Processor to implement the USBD and HCD because in the USB Specification, USBD and HCD are meant to be part of the drivers of an operating system, and USB Client Software access the USB system through calls to the operating system. In the prior art, USBD, HCD and USB Client Software are implemented on the same Main Processor. The fact that prior art USB Host Controllers that have been developed especially for embedded systems, such as those by ScanLogic Inc. and VAutomation Inc., leave the USBD and HCD to the Main Processor is a strong evidence that using a processor separate from the Main Processor to implement the USBD and HCD is not obvious.
In this invention, the USBD and HCD are implemented using a processor other than the Main Processor, the Main Processor access the USB system by writing to and reading from a buffer accessible by both the Main Processor and processor implementing the USB system and the Main Processor. The communication is in predetermined formats.